#!/usr/bin/env node

const http = require('http'),
      log  = console.log,
      addr = process.argv[2];

http.get(addr,(res) => {
  //print response start line
  //HTTP/1.1 200 OK
  log(`HTTP/${res.httpVersion} ${res.statusCode} ${res.statusMessage}`);

  //print response headers
  //Content-Length:22
  log(res.headers);

  //print response body
  //let data = '';
  //res.on('data',(chunk) => {
    //data += chunk;
  //});
  //res.on('end',() => {
    //log(data);
  //});
  res.pipe(process.stdout);
});
